oo::class create PopupGotoDialog {
    superclass PopupDialog
    variable Path PopUpFlag OKVal CancelVal ifDestroy AlertImage

    constructor {args} {
        next {*}$args
        set AlertImage [image create photo -format png -data {
            iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABmJLR0QAAAAAAAD5Q7t/AAAACXBI
            WXMAAA3XAAAN1wFCKJt4AAAAB3RJTUUH1QsODC8BdSmQgQAAAlpJREFUOMutk8tvjFEYh59zvmO+
            ubTzTVudijKarlx2RVCbBpFYsLPTYCES/gJsELGUCImEFWElIbETCbGQSJSFRCVE6UXTmplOzUyn
            893Oa0Gr1UgsPKt387vkvOdVLOHqAXR/T/ZxQuxWO9/MShw5ynEijPkWNf0L2+9xkz9QC8PzY+6J
            XMJc87rb3FxPHrc1hXIcJIzxa/OUR6bC2dGpSWXtob67vF1m8GzQGWwz+nZh92aVzmWRmRBC+R1j
            FKrVoVqt2fEXb+eV0L9goq8eINGecm8Vdm9SabcFmQ4gFMze8yRPvcQMnIFIkEpENpHR3bu2GAt3
            Frz1zvWpR7nuDjftZZFqxEr04iTzllzWc7OF1b1vjnAcQCdhh1foRGZ+iyXykcpnoncPkdrkMjup
            x7SuywtwGEBbP2h1W1IQybJUqX6FYA5b+QJ+DeyvgBiS6VRShO0ARuLYUVqzKJcYqU0Qf3sPxoXv
            49jiMCiFyuRRLV1o7TpK0QZg0CqyzbpRQROZKyGNMohFhh8QDT9Y0l2Q+jRSnyZIbqoDwc+ujlMM
            yiVs5SMyVwSxPze37yLpy4IZOLf8TY0hDOMQGALQTT+6UppqhLqjnX8hyBf86nipAtxf/EhDg2p0
            w7YN6zONspJq7e/qtg7Kq7yJ0uuRib677FpcshY5OPbqS6Oa6gz0mi4wZmXttb1h0XgTxaERFzi5
            4hau72GgL8/19p7VPZkuz8mkTMJo1FxAM4ysPzNWKjUmK/Wk4eiKW1jKjb1c6vXY77lsNJqWyFKb
            9fnwaZYnp59ylv/ND4XdA/mUhOKgAAAAAElFTkSuQmCC
        }]
    }

    method createPopup {msg} {
        next $msg

        frame $Path.goto
        ttk::label $Path.goto.lb -text "Go to"
        ttk::entry $Path.goto.ent
        ttk::label $Path.goto.alert -image {} -width 3

        pack $Path.goto.lb $Path.goto.ent $Path.goto.alert -side left -pady 3
        pack $Path.goto -side top
        focus $Path.goto.ent

        set obj [self object]
        $Path.btns.ok configure -command [list $obj turnOnFlag]
        bind $Path.btns.ok <Return> [list $obj turnOnFlag]
    }

    method turnOnFlag {} {
        set _line [$Path.goto.ent get]
        if [regexp {^[0-9]+$} $_line] {
            set PopUpFlag $_line
            [self object] setDestroy
        } else {
            $Path.goto.alert configure -image $AlertImage
        }
    }

    method turnOffFlag {} {
        set PopUpFlag {}
    }
}